Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
vue-router
Advanced tools
The vue-router npm package is the official router for Vue.js. It integrates closely with Vue.js core to make building Single Page Applications with Vue.js a breeze. Features include nested routes/mappings, modular, component-based router configuration, route params, query, wildcards, transitions, fine-grained navigation control, and view transition effects powered by Vue.js' transition system.
Dynamic Route Matching
This feature allows you to create routes that are dynamically matched to the path. For example, different user IDs can be matched to the same route pattern.
{"const router = new VueRouter({
routes: [
{ path: '/user/:id', component: User }
]
})
const User = {
template: '<div>User {{ $route.params.id }}</div>'
}"}
Nested Routes
This feature allows you to map nested paths to components. It's useful for creating sub-sections of a page without having to create complex configurations.
{"const router = new VueRouter({
routes: [
{ path: '/user/:id', component: User,
children: [
{
// UserProfile will be rendered inside User's <router-view>
path: 'profile',
component: UserProfile
}
]
}
]
})
const User = {
template: '<div>User <router-view></router-view></div>'
}"}
Programmatic Navigation
Vue-router allows you to navigate without using <router-link> by using the router instance methods.
{"router.push('/home')
router.replace('/home')
router.go(-1)"}
Named Routes
Instead of using URLs, you can navigate using route names, making your code more readable and maintainable.
{"const router = new VueRouter({
routes: [
{ name: 'user', path: '/user/:id', component: User }
]
})
// navigate to a named route
router.push({ name: 'user', params: { id: 123 }})"}
Route Guards
Route guards are used to protect routes that require authentication, perform checks before entering a route, or confirm navigation away from a route.
{"const router = new VueRouter({
routes: [
{ path: '/secret', component: Secret, beforeEnter: (to, from, next) => {
// ... guard logic
next();
}}
]
})"}
React Router is a standard library for routing in React. It has a similar set of features to vue-router, such as dynamic route matching, nested routes, and navigation control, but it is designed for React instead of Vue.
Angular's router is a powerful navigation library for Angular. It offers features like lazy loading, nested routes, and route guards. It is comparable to vue-router but is used within the Angular ecosystem.
Reach Router is a small, simple router for React that is accessible and easy to use. It is similar to vue-router but with a focus on simplicity and accessibility.
This is vue-router 3.0 which works only with Vue 2.0.
- For the 1.x router see the 1.0 branch.
- For Vue Router 4 (for Vue 3) see vuejs/router.
Vue Router is part of the Vue Ecosystem and is an MIT-licensed open source project with its ongoing development made possible entirely by the support of Sponsors. If you would like to become a sponsor, please consider:
Get started with the documentation, or play with the examples (see how to run them below).
# install deps
npm install
# build dist files
npm run build
# serve examples at localhost:8080
npm run dev
# lint & run all tests
npm test
# serve docs at localhost:8080
npm run docs
yarn run release
yarn run test
VERSION=<the_version> yarn run build
yarn run changelog
git add dist CHANGELOG.md && git commit -m "[build $VERSION]"
git push origin refs/tags/v$VERSION && git push
npm publish
For questions and support please use the Discord chat server or the official forum. The issue list of this repo is exclusively for bug reports and feature requests.
Please make sure to read the Issue Reporting Checklist before opening an issue. Issues not conforming to the guidelines may be closed immediately.
Please make sure to read the Contributing Guide before making a pull request.
Details changes for each release are documented in the CHANGELOG.md file
.
Copyright (c) 2013-present Evan You
Special thanks to BrowserStack for letting the maintainers use their service to debug browser specific issues.
FAQs
> - This is the repository for Vue Router 4 (for Vue 3) > - For Vue Router 3 (for Vue 2) see [vuejs/vue-router](https://github.com/vuejs/vue-router).
The npm package vue-router receives a total of 2,992,505 weekly downloads. As such, vue-router popularity was classified as popular.
We found that vue-router demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.